import json
capabilities = dict(
    platformName='Android',
    platformVersion='15',
    automationName='uiautomator2',
    deviceName='Android',
    appPackage='tv.danmaku.bili',
    appActivity='.MainActivityV2',
    language='en',
    locale='US',
    noReset = True
)

# capabilities转成json字符串
capabilities = json.dumps(capabilities)

print(capabilities)